3.1.64 \(\int \sin ^3(c+d x) (a+b \sin ^2(c+d x)) \, dx\) [64]

Optimal. Leaf size=51 \[ -\frac {(a+b) \cos (c+d x)}{d}+\frac {(a+2 b) \cos ^3(c+d x)}{3 d}-\frac {b \cos ^5(c+d x)}{5 d} \]

[Out]

-(a+b)*cos(d*x+c)/d+1/3*(a+2*b)*cos(d*x+c)^3/d-1/5*b*cos(d*x+c)^5/d

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3092, 380} \begin {gather*} \frac {(a+2 b) \cos ^3(c+d x)}{3 d}-\frac {(a+b) \cos (c+d x)}{d}-\frac {b \cos ^5(c+d x)}{5 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sin[c + d*x]^3*(a + b*Sin[c + d*x]^2),x]

[Out]

-(((a + b)*Cos[c + d*x])/d) + ((a + 2*b)*Cos[c + d*x]^3)/(3*d) - (b*Cos[c + d*x]^5)/(5*d)

Rule 380

Int[((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x^n
)^p*(c + d*x^n)^q, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && IGtQ[q, 0]

Rule 3092

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[-f^(-1), Subst[I
nt[(1 - x^2)^((m - 1)/2)*(A + C - C*x^2), x], x, Cos[e + f*x]], x] /; FreeQ[{e, f, A, C}, x] && IGtQ[(m + 1)/2
, 0]

Rubi steps

\begin {align*} \int \sin ^3(c+d x) \left (a+b \sin ^2(c+d x)\right ) \, dx &=-\frac {\text {Subst}\left (\int \left (1-x^2\right ) \left (a+b-b x^2\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {\text {Subst}\left (\int \left (a \left (1+\frac {b}{a}\right )-(a+2 b) x^2+b x^4\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {(a+b) \cos (c+d x)}{d}+\frac {(a+2 b) \cos ^3(c+d x)}{3 d}-\frac {b \cos ^5(c+d x)}{5 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 77, normalized size = 1.51 \begin {gather*} -\frac {3 a \cos (c+d x)}{4 d}-\frac {5 b \cos (c+d x)}{8 d}+\frac {a \cos (3 (c+d x))}{12 d}+\frac {5 b \cos (3 (c+d x))}{48 d}-\frac {b \cos (5 (c+d x))}{80 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sin[c + d*x]^3*(a + b*Sin[c + d*x]^2),x]

[Out]

(-3*a*Cos[c + d*x])/(4*d) - (5*b*Cos[c + d*x])/(8*d) + (a*Cos[3*(c + d*x)])/(12*d) + (5*b*Cos[3*(c + d*x)])/(4
8*d) - (b*Cos[5*(c + d*x)])/(80*d)

________________________________________________________________________________________

Maple [A]
time = 0.24, size = 54, normalized size = 1.06

method result size
derivativedivides \(\frac {-\frac {b \left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )}{5}-\frac {a \left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}}{d}\) \(54\)
default \(\frac {-\frac {b \left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )}{5}-\frac {a \left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}}{d}\) \(54\)
risch \(-\frac {3 \cos \left (d x +c \right ) a}{4 d}-\frac {5 b \cos \left (d x +c \right )}{8 d}-\frac {b \cos \left (5 d x +5 c \right )}{80 d}+\frac {a \cos \left (3 d x +3 c \right )}{12 d}+\frac {5 \cos \left (3 d x +3 c \right ) b}{48 d}\) \(71\)
norman \(\frac {-\frac {20 a +16 b}{15 d}-\frac {4 a \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 \left (14 a +16 b \right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {\left (20 a +16 b \right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5}}\) \(93\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(d*x+c)^3*(a+sin(d*x+c)^2*b),x,method=_RETURNVERBOSE)

[Out]

1/d*(-1/5*b*(8/3+sin(d*x+c)^4+4/3*sin(d*x+c)^2)*cos(d*x+c)-1/3*a*(2+sin(d*x+c)^2)*cos(d*x+c))

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 43, normalized size = 0.84 \begin {gather*} -\frac {3 \, b \cos \left (d x + c\right )^{5} - 5 \, {\left (a + 2 \, b\right )} \cos \left (d x + c\right )^{3} + 15 \, {\left (a + b\right )} \cos \left (d x + c\right )}{15 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)^3*(a+b*sin(d*x+c)^2),x, algorithm="maxima")

[Out]

-1/15*(3*b*cos(d*x + c)^5 - 5*(a + 2*b)*cos(d*x + c)^3 + 15*(a + b)*cos(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 0.39, size = 43, normalized size = 0.84 \begin {gather*} -\frac {3 \, b \cos \left (d x + c\right )^{5} - 5 \, {\left (a + 2 \, b\right )} \cos \left (d x + c\right )^{3} + 15 \, {\left (a + b\right )} \cos \left (d x + c\right )}{15 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)^3*(a+b*sin(d*x+c)^2),x, algorithm="fricas")

[Out]

-1/15*(3*b*cos(d*x + c)^5 - 5*(a + 2*b)*cos(d*x + c)^3 + 15*(a + b)*cos(d*x + c))/d

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 107 vs. \(2 (44) = 88\).
time = 0.26, size = 107, normalized size = 2.10 \begin {gather*} \begin {cases} - \frac {a \sin ^{2}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{d} - \frac {2 a \cos ^{3}{\left (c + d x \right )}}{3 d} - \frac {b \sin ^{4}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{d} - \frac {4 b \sin ^{2}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{3 d} - \frac {8 b \cos ^{5}{\left (c + d x \right )}}{15 d} & \text {for}\: d \neq 0 \\x \left (a + b \sin ^{2}{\left (c \right )}\right ) \sin ^{3}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)**3*(a+b*sin(d*x+c)**2),x)

[Out]

Piecewise((-a*sin(c + d*x)**2*cos(c + d*x)/d - 2*a*cos(c + d*x)**3/(3*d) - b*sin(c + d*x)**4*cos(c + d*x)/d -
4*b*sin(c + d*x)**2*cos(c + d*x)**3/(3*d) - 8*b*cos(c + d*x)**5/(15*d), Ne(d, 0)), (x*(a + b*sin(c)**2)*sin(c)
**3, True))

________________________________________________________________________________________

Giac [A]
time = 0.43, size = 67, normalized size = 1.31 \begin {gather*} -\frac {b \cos \left (d x + c\right )^{5}}{5 \, d} + \frac {a \cos \left (d x + c\right )^{3}}{3 \, d} + \frac {2 \, b \cos \left (d x + c\right )^{3}}{3 \, d} - \frac {a \cos \left (d x + c\right )}{d} - \frac {b \cos \left (d x + c\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)^3*(a+b*sin(d*x+c)^2),x, algorithm="giac")

[Out]

-1/5*b*cos(d*x + c)^5/d + 1/3*a*cos(d*x + c)^3/d + 2/3*b*cos(d*x + c)^3/d - a*cos(d*x + c)/d - b*cos(d*x + c)/
d

________________________________________________________________________________________

Mupad [B]
time = 13.37, size = 44, normalized size = 0.86 \begin {gather*} -\frac {\frac {b\,{\cos \left (c+d\,x\right )}^5}{5}+\left (-\frac {a}{3}-\frac {2\,b}{3}\right )\,{\cos \left (c+d\,x\right )}^3+\left (a+b\right )\,\cos \left (c+d\,x\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(c + d*x)^3*(a + b*sin(c + d*x)^2),x)

[Out]

-((b*cos(c + d*x)^5)/5 - cos(c + d*x)^3*(a/3 + (2*b)/3) + cos(c + d*x)*(a + b))/d

________________________________________________________________________________________